package cn.com.chengmandian.service.erp;

import cn.com.chengmandian.core.web.pojo.AjaxResult;
import cn.com.chengmandian.service.erp.fallback.ErpCenterClientFallback;
import cn.com.chengmandian.service.erp.form.*;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

@FeignClient(name = "cmd-erp-center",fallback = ErpCenterClientFallback.class)
public interface ErpCenterClient {

    //通过手机号绑定钉钉
    @PostMapping("/erpcenter/erp/oa/bind/dingding/{userId}/{mobile}")
    AjaxResult bindDingDing(@PathVariable("userId")Integer userId,@PathVariable("mobile")String mobile);

    //erp 提交审批(自定义)
    @PostMapping("/erpcenter/inner/erp/oa/send/custom/audit")
    AjaxResult sendCustomAudit(@RequestBody OaSendCustomAuditForm form);

    //erp 提交审批(依赖钉钉)
    @PostMapping("/erpcenter/inner/erp/oa/send/ding/audit")
    AjaxResult sendDingAudit(@RequestBody OaSendDingAuditForm form);

    // erp 同意审批
    @PostMapping("/erpcenter/inner/erp/oa/agree/audit")
    AjaxResult agreeAudit(@RequestBody OaAgreeAuditForm form);

    // erp 拒绝审批
    @PostMapping("/erpcenter/inner/erp/oa/disagree/audit")
    AjaxResult disAgreeAudit(@RequestBody OaDisagreeAuditForm form);

    // 撤销钉钉审批流程
    @PostMapping("/erpcenter/inner/erp/oa/cancel/audit")
    AjaxResult cancelAudit(@RequestBody OaCancelProcessForm form);

    // erp 消息通知
    @PostMapping("/erpcenter/inner/erp/oa/ding/message")
    AjaxResult dingMsg(@RequestBody DingDingMsgForm form);

    // 发送验证码
    @PostMapping("/erpcenter/inner/common/auth/send")
    AjaxResult  authSend(@RequestBody AuthSendForm form);


    // 效验验证码
    @PostMapping("/erpcenter/inner/common/auth/check")
    AjaxResult  authCheck(@RequestBody AuthCheckForm form);

    // ERP钉钉机器人通知
    @PostMapping("/erpcenter/inner/common/robot")
    AjaxResult robot(@RequestBody RobotForm form);
}
